import requests

url = "https://www.baidu.com"

r = requests.get(url)
print(r.headers)  # 响应头
# {'Set-Cookie': 'BDORZ=27315; max-age=86400; domain=.baidu.com; path=/'}    响应头其他删除 只看cookie

print(r.headers.get('Set-Cookie'))   # BDORZ=27315; max-age=86400; domain=.baidu.com; path=/
print(r.cookies)  # <RequestsCookieJar[<Cookie BDORZ=27315 for .baidu.com/>]>
print('------------------')
cookies = requests.utils.dict_from_cookiejar(r.cookies)  # 对cookies进行处理 返回cookies的字典格式
print(cookies)  # {'BDORZ': '27315'}



